/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package seso;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Image;

/**
 *
 * @author Administrator
 */
public class RTableHeaderLabel extends javax.swing.JLabel {
    
    private String headerText = "";
    
    //private Color seperatorLineColor = new Color(143,168,189); // 原始颜色
    private Color seperatorLineColor = new Color(163,188,209); // 加深了一点 
    private Color headerBackgroundColor = new Color(114,158,191); 
    
    public RTableHeaderLabel() {
        super();
        
        setForeground(java.awt.Color.WHITE);
        setBackground(headerBackgroundColor);
        
        setFont(new Font("Arial", Font.BOLD, 11));
        
        setSize(1, 40);  // 40: Core Height of table header
        setPreferredSize(new java.awt.Dimension(1, 40));   
    }
    

    @Override
    protected void paintComponent(Graphics g) {
        
        if (java.beans.Beans.isDesignTime()) {
            super.paintComponent(g);
            return;
        }
        g.drawString(getHeaderText(), 6, 10);
        
        g.setColor(seperatorLineColor);
        g.drawLine(getWidth() - 1, 0, getWidth() - 1, getHeight() - 2);
        
        super.paintComponent(g);
    }
    

    /**
     * @return the headerText
     */
    public String getHeaderText() {
        return headerText;
    }

    /**
     * @param headerText the headerText to set
     */
    public void setHeaderText(String headerText) {
        this.headerText = headerText;
    }
    
}
